package com.haina.shop.controller.user;

import com.haina.shop.domain.Area;
import com.haina.shop.result.ServiceResult;
import com.haina.shop.service.AreaService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/p/area")
public class AreaController {

    @Resource
    private AreaService areaService;


    @GetMapping("/listByPid")
    private ServiceResult selByPid(long pid){
        List<Area> list = areaService.selByPid(pid);
        return ServiceResult.success(list);
    }
}
